import cv2 as cv
import sys
import os
from python_ai.common.xcommon import *
import matplotlib.pyplot as plt
import numpy as np
import time
import datetime

img_dir = '../../../../large_data/pic'
img_name = 'friends.png'
img_path1 = os.path.join(img_dir, img_name)

sep('load')
img = cv.imread(img_path1, cv.IMREAD_COLOR)
print('original shape', img.shape)
H, W, _ = img.shape
H2 = (H - 1) // 2
W2 = (W - 1) // 2
cv.imshow('ori', img)

sep('x2')
res = cv.resize(img, (W * 2, H * 2), interpolation=cv.INTER_CUBIC)
cv.imshow('x2', res)

sep('x0.5')
res = cv.resize(img, None, (W // 2, H // 2), interpolation=cv.INTER_CUBIC)
cv.imshow('x0.5', res)
